package controllers;

import java.util.List;

import models.Wanted;
import play.mvc.Controller;

public class WantMngt extends Controller {

    public static void displayList() {
        
    	Long userId = Security.getConnectedUser().getId();
    	
    	List<Wanted> list = Wanted.find("select r from Wanted r " +
    			"left join fetch r.book b " + // join fetch pour recup les données de la jointure
    			"left join fetch r.cartoon a " +
    			"where r.user.id = ? ", userId).fetch();
    	
    	render(list);
    }
    
    

}
